package com.example.service;

import com.example.entity.User;
import com.example.mapper.UserMapper;
import com.example.vo.UserVO;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    public List<UserVO> getUserList() {
        List<User> userList = userMapper.queryAllUser();
        List<UserVO> userVOList = new ArrayList<>();
        for (User user : userList) {
            UserVO userVO = new UserVO();
            userVO.setUsername(user.getUsername());
            userVO.setUserId(user.getUserId());
            userVO.setWechat(user.getWechat());
            userVOList.add(userVO);
        }
        return userVOList;
    }
}
